<?php
$width=Yii::app()->params['dialog']['findTruckForTailBoard']['width'];
$height=Yii::app()->params['dialog']['findTruckForTailBoard']['height'];
$width1=Yii::app()->params['dialog']['findTypeForTailBoard']['width'];
$height1=Yii::app()->params['dialog']['findTypeForTailBoard']['height'];
$cs=Yii::app()->clientScript;
$cs->registerScriptFile('./js/modal.js');
$cs->registerScript('type_merit_ratio_dialog',<<<END
function Block(){\$.modal('?r=dialog/findTruckForTailBoard',{width:$width,height:$height,title:'请选择车辆'});return false;}
function Block1(){\$.modal('?r=dialog/findTypeForTailBoard',{height:$height1,width:$width1,title:'请选择车型'});return false;}	
$("#findTruck").click(Block);
$("#findType").click(Block1);
$("#delTruck").click(function(){\$("#Tail_board_truck_plate_no").val('');$("#Tail_board_fk_truck_id").val('-1');return false;});
END
)
?>
<div class="yiiForm">
<?php
	echo EHtml::form();	
	EHtml::setOptions(array('errorElement'=> 'span'));
	EHtml::setScenario($update ? 'update' : 'create');				  		
?>
<div>注：<span class="required">*</span>为必填项</div>
<div id="leftaa">
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'reg_no'); ?>
<?php echo EHtml::activeTextField($model,'reg_no',array('size'=>18,'maxlength'=>18)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'plate_no'); ?>
<?php echo EHtml::activeTextField($model,'plate_no',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'truck_plate_no'); ?>
<?php echo EHtml::activeTextField($model,'truck_plate_no',array('size'=>10,'maxlength'=>10,'class'=>'readonly','readOnly'=>'true','tb_plate'=>true)); ?>
<?php echo CHtml::activeHiddenField($model,'fk_truck_id');?>&nbsp;&nbsp;<a id="findTruck" href="#">查找车辆</a>&nbsp;&nbsp;<a id="delTruck" href="#">清除</a>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'property_owner'); ?>
<?php echo EHtml::activeTextField($model,'property_owner',array('size'=>25,'maxlength'=>50)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'reg_date'); ?>
<?php echo EHtml::activeTextField($model,'reg_date',array('size'=>8,'maxlength'=>10,"id"=>"reg_date",)); ?>
<?php $this->widget('application.extensions.calendar.SCalendar',array('inputField'=>'reg_date','ifFormat'=>'%Y-%m-%d',));?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'manufacture_date'); ?>
<?php echo EHtml::activeTextField($model,'manufacture_date',array('size'=>8,'maxlength'=>10,"id"=>"manufacture_date",)); ?>
<?php $this->widget('application.extensions.calendar.SCalendar',array('inputField'=>'manufacture_date','ifFormat'=>'%Y-%m-%d',));?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'scrap_date'); ?>
<?php echo EHtml::activeTextField($model,'scrap_date',array('size'=>8,'maxlength'=>10,"id"=>"scrap_date",)); ?>
<?php $this->widget('application.extensions.calendar.SCalendar',array('inputField'=>'scrap_date','ifFormat'=>'%Y-%m-%d',));?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'type'); ?>
<?php echo EHtml::activeTextField($model,'type',array('size'=>10,'maxlength'=>10,'class'=>'readonly','readOnly'=>'true')); ?>
<?php echo CHtml::activeHiddenField($model,'fk_type_id');?>&nbsp;&nbsp;<a id="findType" href="#">查找车型</a>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'brand'); ?>
<?php echo EHtml::activeTextField($model,'brand',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'type_id'); ?>
<?php echo EHtml::activeTextField($model,'type_id',array('size'=>25,'maxlength'=>30)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'body_color'); ?>
<?php echo EHtml::activeTextField($model,'body_color',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'frame_no'); ?>
<?php echo EHtml::activeTextField($model,'frame_no',array('size'=>25,'maxlength'=>30)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'engine_no'); ?>
<?php echo EHtml::activeTextField($model,'engine_no',array('size'=>18,'maxlength'=>18)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'engine_type_id'); ?>
<?php echo EHtml::activeTextField($model,'engine_type_id',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'fuel_type'); ?>
<?php echo CHtml::activeRadioButton($model,'fuel_type',array('value'=>0,'checked'=>'checked'));?>柴油
<?php echo CHtml::activeRadioButton($model,'fuel_type',array('value'=>1));?>汽油
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'displacement_power'); ?>
<?php echo EHtml::activeTextField($model,'displacement_power',array('size'=>15,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'manufacturer'); ?>
<?php echo EHtml::activeTextField($model,'manufacturer',array('size'=>20,'maxlength'=>50)); ?>
</div>
<div class="simple1"  style="margin-bottom:-1px;">
<?php echo CHtml::activeLabelEx($model,'steering_type'); ?>
<?php echo EHtml::activeTextField($model,'steering_type',array('size'=>10,'maxlength'=>10)); ?>
</div>
</div>
  <div id="rightaa">
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'tire_distance'); ?>
<?php echo EHtml::activeTextField($model,'tire_distance',array('size'=>12,'maxlength'=>10)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'tire_num'); ?>
<?php echo EHtml::activeDropDownList($model,'tire_num',$model->tireNumOptions); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'tire_format'); ?>
<?php echo EHtml::activeTextField($model,'tire_format',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'leaf_spring_num'); ?>
<?php echo EHtml::activeTextField($model,'leaf_spring_num',array('size'=>8)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'wheelbase'); ?>
<?php echo EHtml::activeTextField($model,'wheelbase',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'wheel_distince'); ?>
<?php echo EHtml::activeTextField($model,'wheel_distince',array('size'=>10,'maxlength'=>10)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'gabarite'); ?>
<?php echo EHtml::activeTextField($model,'gabarite',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'container_immer_dimensions'); ?>
<?php echo EHtml::activeTextField($model,'container_immer_dimensions',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'origin'); ?>
<?php echo CHtml::activeRadioButton($model,'origin',array('value'=>0,'checked'=>'checked'));?>国产
<?php echo CHtml::activeRadioButton($model,'origin',array('value'=>1));?>进口
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'total_weight'); ?>
<?php echo EHtml::activeTextField($model,'total_weight',array('size'=>8)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'rated_loading_weight'); ?>
<?php echo EHtml::activeTextField($model,'rated_loading_weight',array('size'=>8)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'rated_passenger_capacity'); ?>
<?php echo EHtml::activeTextField($model,'rated_passenger_capacity',array('size'=>8)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'total_traction_weight'); ?>
<?php echo EHtml::activeTextField($model,'total_traction_weight',array('size'=>8)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'passenger_capacity_of_cap'); ?>
<?php echo EHtml::activeTextField($model,'passenger_capacity_of_cap',array('size'=>8)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'use_naure'); ?>
<?php echo EHtml::activeTextField($model,'use_naure',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple1">
<?php echo CHtml::activeLabelEx($model,'obtain_way'); ?>
<?php echo EHtml::activeTextField($model,'obtain_way',array('size'=>20,'maxlength'=>20)); ?>
</div>
<div class="simple">
<?php echo CHtml::activeLabelEx($model,'depreciation'); ?>
<?php echo EHtml::activeTextField($model,'depreciation',array('size'=>8)); ?>
</div>
<div class="simple1"  style="margin-bottom:-1px;">
<?php echo CHtml::activeLabelEx($model,'total_cost'); ?>
<?php echo EHtml::activeTextField($model,'total_cost',array('size'=>8)); ?>
</div>
</div>
<div class="action">
<?php echo EHtml::submitButton($update ? '更新信息' : '添加信息'); ?>
</div>

<?php echo EHtml::endForm(); ?>

</div><!-- yiiForm -->
<?php 
if($model->hasErrors()) echo "<script>alert('您填写的信息有误！请根据页面红色图标提示修改。');</script>";
?>